package cn.stylefeng.guns.modular.gridsystem.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.gridsystem.service.BizFosInfoService;
import cn.stylefeng.guns.modular.gridsystem.model.param.BizFosInfoParam;
import javax.annotation.Resource;

/**
 * 光纤传感器信息 控制器
 *
 * @author: ssy
 * @date: 2023/02/03 09:53
 */
@RestController
public class BizFosInfoController {

    @Resource
    private BizFosInfoService bizFosInfoService;

    /**
     * 分页查询光纤传感器信息
     *
     * @author ssy
     * @date 2023/02/03 09:53
     */
    @GetMapping("/bizFosInfo/page")
    @BusinessLog(title = "光纤传感器信息_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(BizFosInfoParam bizFosInfoParam) {
        return new SuccessResponseData(bizFosInfoService.page(bizFosInfoParam));
    }

    /**
     * 获取全部光纤传感器信息
     *
     * @author ssy
     * @date 2023/02/03 09:53
     */
    @GetMapping("/bizFosInfo/list")
    @BusinessLog(title = "光纤传感器信息_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(BizFosInfoParam bizFosInfoParam) {
        return new SuccessResponseData(bizFosInfoService.list(bizFosInfoParam));
    }

    /**
     * 查看详情光纤传感器信息
     *
     * @author ssy
     * @date 2023/02/03 09:53
     */
    @GetMapping("/bizFosInfo/detail")
    @BusinessLog(title = "光纤传感器信息_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(BizFosInfoParam.detail.class) BizFosInfoParam bizFosInfoParam) {
        return new SuccessResponseData(bizFosInfoService.detail(bizFosInfoParam));
    }

    /**
     * 添加光纤传感器信息
     *
     * @author ssy
     * @date 2023/02/03 09:53
     */
    @PostMapping("/bizFosInfo/add")
    @BusinessLog(title = "光纤传感器信息_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BizFosInfoParam.add.class) BizFosInfoParam bizFosInfoParam) {
        bizFosInfoService.add(bizFosInfoParam);
        return new SuccessResponseData();
    }

    /**
     * 删除光纤传感器信息
     *
     * @author ssy
     * @date 2023/02/03 09:53
     */
    @PostMapping("/bizFosInfo/delete")
    @BusinessLog(title = "光纤传感器信息_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(BizFosInfoParam.delete.class) BizFosInfoParam bizFosInfoParam) {
        bizFosInfoService.delete(bizFosInfoParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑光纤传感器信息
     *
     * @author ssy
     * @date 2023/02/03 09:53
     */
    @PostMapping("/bizFosInfo/edit")
    @BusinessLog(title = "光纤传感器信息_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(BizFosInfoParam.edit.class) BizFosInfoParam bizFosInfoParam) {
        bizFosInfoService.edit(bizFosInfoParam);
        return new SuccessResponseData();
    }


}
